//
//  GTMeHeaderView.m
//  GiftTalk
//
//  Created by Wan on 16/4/12.
//  Copyright © 2016年 Wan. All rights reserved.
//

#import "GTMeHeaderView.h"
#import "GTSettingViewController.h"

@interface GTMeHeaderView ()

#pragma mark - Top ToolBar

- (IBAction)message:(UIButton *)sender;
- (IBAction)giftmind:(UIButton *)sender;
- (IBAction)setting:(UIButton *)sender;
- (IBAction)scan:(UIButton *)sender;

#pragma mark - Bottom ToolBar

- (IBAction)shopingCart;
- (IBAction)order;
- (IBAction)coupon;
- (IBAction)service;

@end

@implementation GTMeHeaderView


+ (instancetype)headerView {
   return [self viewFromXib];
}


- (void)setUserIconView:(UIImageView *)userIconView {
    _userIconView = userIconView;
    
    userIconView.layer.cornerRadius = 30;
    userIconView.clipsToBounds = YES;
}

- (void)setUserScoreButton:(UIButton *)userScoreButton {
    _userScoreButton = userScoreButton;
    
    userScoreButton.layer.cornerRadius = 8;
    userScoreButton.clipsToBounds = YES;
}

#pragma mark - Method

- (IBAction)message:(UIButton *)sender {
    GTLogFunc
}

- (IBAction)giftmind:(UIButton *)sender {
    GTLogFunc
}

- (IBAction)setting:(UIButton *)sender {
//    GTSettingViewController *settingVc = [[GTSettingViewController alloc] init];
//    
//    UIViewController *rootVc = self.window.rootViewController;
//    
//    [rootVc presentViewController:settingVc animated:YES completion:nil];
    
    // 根据根控制器,找到跟控制器 modal 出的控制器, 所对应的导航控制器
//    UIViewController *rootVc = [UIApplication sharedApplication].keyWindow.rootViewController;

//    UINavigationController *nav = (UINavigationController *)rootVc.presentedViewController;
//    GTLog(@"%@ == %@",rootVc, nav);
//    [nav pushViewController:settingVc animated:YES];
    
}

- (IBAction)scan:(UIButton *)sender {
    GTLogFunc
}
- (IBAction)shopingCart {
    GTLogFunc
}

- (IBAction)order {
    GTLogFunc;
}

- (IBAction)coupon {
    GTLogFunc
}

- (IBAction)service {
    GTLogFunc;
}
@end
